import csv
from faker import Faker

fake = Faker()

# 生成数据
data = []
for i in range(100):
    username = fake.user_name()
    password = fake.password(special_chars=False, digits=True, upper_case=True, lower_case=True)
    data.append([username, password, '200'])

# 写入CSV文件
with open('data1.csv', 'w', newline='', encoding='utf-8') as file:
    writer = csv.writer(file)
    writer.writerows(data)

print('数据已保存到data1.csv文件中')
